{% extends 'layout.html' %}

{% block content %}

<div class="edit">
    {# "shortcut-submit" is a class used exclusively from javascript
     # to submit the form when a key (Ctrl+Enter) is pressed.
     #}
    <form action="" method="post" class="submit shortcut-submit">
        <input type="hidden" name="post" value="{{ post.hashId }}" />
        
        <h3>Title <em>(required)</em></h3>
        <div>
            <input type="text" name="title" class="form-control" value="{{ post.title }}" required='required' />
        </div>
        <div class="info">
            by <a href="{{ url ('user_public', username=post.username) }}">{{ post.username }}</a>
            <time title="{{ post.created|title }}" datetime="{{ post.created|datetime }}"><em> {{ post.created|ago }} </em></time>
        </div>

        <h3>Link</h3>
        <div>
            <input type="text" name="link" class="form-control" value="{{ post.link }}" />
        </div>

        <h3>Text</h3>
        <div>
            <textarea name="text" rows=10 class="form-control">{{ post.text }}</textarea>
        </div>

        <div style="margin: 1em 0 0 0;">
            <input type="submit" class="button button_info" value="Save changes" />
        </div>
    </form>
</div>

{% endblock %}
